import { prop, ModelOptions,Ref, Prop } from "@typegoose/typegoose";
import { User } from '@libs/db/models/user.model'
import { Course } from '@libs/db/models/course.model' 
import { Episode } from '@libs/db/models/episode.model' 


@ModelOptions({
    schemaOptions:{
        timestamps:true
    }
})

export class Action {
    @prop({ ref:'User' })
    user:Ref<User>

    @prop({ enum:['Course','Episode'] })
    type:string;

    @prop({ refPath:'type' })
    object:Ref<Course|Episode>

    @Prop({ enum:['like','upVote'] })
    name:string


}